package o;

import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;

public class gci {
    private int ˊ = 0;
    private String ॱ;

    public gci(String str) {
        gbj.ˋ((Object) str);
        this.ॱ = str;
    }

    public boolean ˊ() {
        return ʼ() == 0;
    }

    private int ʼ() {
        return this.ॱ.length() - this.ˊ;
    }

    public boolean ॱ(String str) {
        return this.ॱ.regionMatches(true, this.ˊ, str, 0, str.length());
    }

    public boolean ˎ(String... strArr) {
        for (String ॱ : strArr) {
            if (ॱ(ॱ)) {
                return true;
            }
        }
        return false;
    }

    public boolean ॱ(char... cArr) {
        if (ˊ()) {
            return false;
        }
        for (char c : cArr) {
            if (this.ॱ.charAt(this.ˊ) == c) {
                return true;
            }
        }
        return false;
    }

    public boolean ˋ(String str) {
        if (!ॱ(str)) {
            return false;
        }
        this.ˊ += str.length();
        return true;
    }

    public boolean ˎ() {
        return !ˊ() && gbk.ˋ(this.ॱ.charAt(this.ˊ));
    }

    public boolean ॱ() {
        return !ˊ() && Character.isLetterOrDigit(this.ॱ.charAt(this.ˊ));
    }

    public char ˋ() {
        String str = this.ॱ;
        int i = this.ˊ;
        this.ˊ = i + 1;
        return str.charAt(i);
    }

    public void ˎ(String str) {
        if (ॱ(str)) {
            int length = str.length();
            if (length > ʼ()) {
                throw new IllegalStateException("Queue not long enough to consume sequence");
            }
            this.ˊ = length + this.ˊ;
            return;
        }
        throw new IllegalStateException("Queue did not match expected sequence");
    }

    public String ˊ(String str) {
        int indexOf = this.ॱ.indexOf(str, this.ˊ);
        if (indexOf == -1) {
            return ʻ();
        }
        String substring = this.ॱ.substring(this.ˊ, indexOf);
        this.ˊ += substring.length();
        return substring;
    }

    public String ˋ(String... strArr) {
        int i = this.ˊ;
        while (!ˊ() && !ˎ(strArr)) {
            this.ˊ++;
        }
        return this.ॱ.substring(i, this.ˊ);
    }

    public String ˏ(String str) {
        String ˊ = ˊ(str);
        ˋ(str);
        return ˊ;
    }

    public String ˊ(char c, char c2) {
        Object obj = null;
        Object obj2 = null;
        char c3 = '\u0000';
        int i = 0;
        int i2 = -1;
        int i3 = -1;
        while (!ˊ()) {
            Character valueOf = Character.valueOf(ˋ());
            if (c3 == '\u0000' || c3 != '\\') {
                if (valueOf.equals(Character.valueOf('\'')) && valueOf.charValue() != c && obj == null) {
                    obj2 = obj2 == null ? 1 : null;
                } else if (valueOf.equals(Character.valueOf('\"')) && valueOf.charValue() != c && obj2 == null) {
                    if (obj == null) {
                        int i4 = 1;
                    } else {
                        obj = null;
                    }
                }
                if (obj2 == null && r0 == null) {
                    if (valueOf.equals(Character.valueOf(c))) {
                        i++;
                        if (i3 == -1) {
                            i3 = this.ˊ;
                        }
                    } else if (valueOf.equals(Character.valueOf(c2))) {
                        i--;
                    }
                }
                if (i <= 0) {
                    break;
                }
            }
            if (i > 0 && c3 != '\u0000') {
                i2 = this.ˊ;
            }
            c3 = valueOf.charValue();
            continue;
            if (i <= 0) {
                break;
            }
        }
        String substring = i2 >= 0 ? this.ॱ.substring(i3, i2) : "";
        if (i > 0) {
            gbj.ˏ("Did not find balanced marker at '" + substring + "'");
        }
        return substring;
    }

    public static String ʻ(String str) {
        int i = 0;
        StringBuilder ˏ = gbk.ˏ();
        char[] toCharArray = str.toCharArray();
        int length = toCharArray.length;
        int i2 = 0;
        while (i < length) {
            char c = toCharArray[i];
            if (c != '\\') {
                ˏ.append(c);
            } else if (i2 != 0 && i2 == 92) {
                ˏ.append(c);
            }
            i++;
            char c2 = c;
        }
        return gbk.ˎ(ˏ);
    }

    public boolean ˏ() {
        boolean z = false;
        while (ˎ()) {
            this.ˊ++;
            z = true;
        }
        return z;
    }

    public String ᐝ() {
        int i = this.ˊ;
        while (!ˊ()) {
            if (!ॱ()) {
                if (!ˎ("*|", HiAnalyticsConstant.REPORT_VAL_SEPARATOR, "_", "-")) {
                    break;
                }
            }
            this.ˊ++;
        }
        return this.ॱ.substring(i, this.ˊ);
    }

    public String ʽ() {
        int i = this.ˊ;
        while (!ˊ() && (ॱ() || ॱ('-', '_'))) {
            this.ˊ++;
        }
        return this.ॱ.substring(i, this.ˊ);
    }

    public String ʻ() {
        String substring = this.ॱ.substring(this.ˊ, this.ॱ.length());
        this.ˊ = this.ॱ.length();
        return substring;
    }

    public String toString() {
        return this.ॱ.substring(this.ˊ);
    }
}
